<% include ../pageHeader %>

<div id="mainWrapper">
    <div id="content" class="content">
        <div id="innerContent">
            <div class="textbox">
                <div class="textbox-title"><h4><%= __('announcement') %></h4></div>
                <div style="width: 100%">
                    <script language="javascript" src="messageform.js"></script>
                        <form name="inputform" method="post" action="?in=announce&act=update">
                            <input name="_csrf" type="hidden" value="<%- ctx.csrf %>" />
                    <table border="0" cellpadding="3" cellspacing="2" width="100%">
                            <tr>
                                <td class="formbox-rowheader" width="150"><%= __('enabled') %>:</td>
                                <td class="formbox-content"><input type="checkbox" name="show" value="true"
                                            <% if(theCache.settings["announceShow"] == 1){%>
                                                                   checked="checked"
                                            <% } %>
                                    /><%= __('show_announce') %></td>
                            </tr>
                            <tr>
                                <td class="formbox-rowheader">
                                    <div class="panel-smilies">
                                        <div class="panel-smilies-title"><%= __('smilies') %></div>
                                        <div class="panel-smilies-content">
                                            <% for(var i = 0;i < theCache.smilies.length;i++){ %>
                                                <a href="javascript:insertSmilies('<%= theCache.smilies[i].code %>')"><img
                                                            src="/public/<%= theCache.settings["smiliesFolder"] %>/<%= theCache.smilies[i].image %>"
                                                            alt="<%= theCache.smilies[i].code %>"/></a>
                                                <% if((i + 1) % theCache.settings["smiliesPerRow"] == 0) {%>
                                                    <br />
                                                <% } %>

                                            <% } %>
                                        </div>
                                        <div style="font-weight: normal; text-align:left;">
                                            <input name="e_html" type="checkbox" value="true"
                                                    <% if(theCache.settings["announceUBBFlags"] == "html") {%>
                                                   checked="checked"
                                                    <% } %>
                                            /> <%= __('e_html') %><br/>
                                            <input name="e_ubb" type="checkbox" value="true"
                                                    <% if(theCache.settings["announceUBBFlags"] != "html" &&
                                                            theCache.settings["announceUBBFlags"].substr(0, 1) ==
                                                            "1") {%>
                                                   checked="checked"
                                                    <% } %>
                                            /> <%= __('e_ubb') %><br/>
                                            <input name="e_autourl" type="checkbox" value="true"
                                                    <% if(theCache.settings["announceUBBFlags"] != "html" &&
                                                            theCache.settings["announceUBBFlags"].substr(1, 1) ==
                                                            "1") {%>
                                                   checked="checked"
                                                    <% } %>
                                            /> <%= __('e_autourl') %><br/>
                                            <input name="e_image" type="checkbox" value="true"
                                                    <% if(theCache.settings["announceUBBFlags"] != "html" &&
                                                            theCache.settings["announceUBBFlags"].substr(2, 1) ==
                                                            "1") {%>
                                                   checked="checked"
                                                    <% } %>
                                            /> <%= __('e_image') %><br/>
                                            <input name="e_media" type="checkbox" value="true"
                                                    <% if(theCache.settings["announceUBBFlags"] != "html" &&
                                                            theCache.settings["announceUBBFlags"].substr(3, 1) ==
                                                            "1") {%>
                                                   checked="checked"
                                                    <% } %>
                                            /> <%= __('e_media') %><br/>
                                            <input name="e_smilies" type="checkbox" value="true"
                                                    <% if(theCache.settings["announceUBBFlags"] != "html" &&
                                                            theCache.settings["announceUBBFlags"].substr(4, 1) ==
                                                            "1") {%>
                                                   checked="checked"
                                                    <% } %>
                                            /> <%= __('e_smilies') %>
                                        </div>
                                </td>
                                <td class="formbox-content">
                                    <textarea name="message" cols="64" rows="16" wrap="virtual" id="message"
                                              style="width:100%" onSelect="storeCaret(this);"
                                              onClick="storeCaret(this);"
                                              onKeyup="storeCaret(this);CtrlEnter();"><%= helper.HTMLEncodeLite(
                                                theCache.settings["announce"]) %></textarea>
                                    <br/>
                                    <input type="submit" name="submit" value=" <%= __('save_change') %> "
                                           class="button"/>
                                </td>
                            </tr>
                    </table>
                        </form>
                </div>
            </div>
        </div>
    </div>
    <% include adminSidebar %>
    <div class="clear"></div>
</div>
<% include ../pageFooter %>
